/******************************************************************************
** 
** Counting in strings.
** 
** File name:	str_count.c
** Compilation:	cc str_count.c -o str_count
** Execution:	./str_count
** 
** Description:
** 1. Prints the number of inputted strings.
** 2. Prints the number of spaces and tabs in those strings.
** 
******************************************************************************/
#include <stdio.h>

main()
{
    int c, nl, ns, nt;
    
    nl = 0;
    ns = 0;
    nt = 0;
    while((c = getchar()) != EOF) {
        if (c == '\n') {
            ++nl;
        } else if (c == ' ') {
          ++ns;
        } else if (c == '\t') {
          ++nt;
        }
    }
    
    printf("\nNumber of strings: %d\n", nl);
    printf("Number of spaces: %d\n", ns);
    printf("Number of tabs: %d\n", nt);
}

